﻿using HoverTree.BLL;
using System;
using System.Web;

namespace HoverTreeMobile.HvtAdmin
{
    public partial class PanelUserAlterPassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            ltlUserName.Text = HttpContext.Current.User.Identity.Name;
        }

        protected void buttonOK_Click(object sender, EventArgs e)
        {
            if (textBoxPasswordNew.Text != textBoxPasswordConfirm.Text)
            {
                literalTips.Text = "新密码和确认密码不同";
                return;
            }

            HvtPanelUser m_panelUser = new HvtPanelUser();

            literalTips.Text = m_panelUser.AlterPassword(HttpContext.Current.User.Identity.Name, textBoxPasswordBefore.Text, textBoxPasswordNew.Text);

            if (literalTips.Text == string.Empty)
                literalTips.Text = "密码已修改";
        }
    }
}